import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import VueClipboard2 from "vue-clipboard2";
import Antd from "./antd";
import i18n from "./locales";
import directives from "./utils/directives";
import Authorized from "./components/Authorized";
import storage from "./utils/storage";

import "./styles/index.less";

Vue.config.productionTip = false;

Vue.use(VueClipboard2);
Vue.use(Antd);
Vue.use(directives);
Vue.component("Authorized", Authorized);

new Vue({
  router,
  store,
  i18n,
  created() {
    store.dispatch("setLang", storage.getItem("lang") || "zh-CN");
  },
  render: h => h(App)
}).$mount("#app");
